<script setup lang="ts">
import { ref } from 'vue'
import MainAside from './component/main-aside/main-aside.vue'
import MainHeader from './component/main-header/main-header.vue'

// 1.改变aside的宽度
const isFold = ref(false)
const handleChangeFold = (isFoldValue: boolean) => {
  isFold.value = isFoldValue
}
</script>

<template>
  <div class="main">
    <el-container class="main-content">
      <el-aside :width="isFold ? '60px' : '210px'">
        <MainAside :is-fold="isFold" />
      </el-aside>
      <el-container>
        <el-header height="50px"><MainHeader @handle-change-fold="handleChangeFold" /></el-header>
        <el-main><RouterView /></el-main>
      </el-container>
    </el-container>
  </div>
</template>

<style lang="less" scoped>
.main {
  width: 100%;
  height: 100%;
}
.main-content {
  height: 100%;

  .el-aside {
    overflow-x: hidden;
    overflow-y: auto;
    line-height: 200px;
    text-align: left;
    cursor: pointer;
    background-color: #001529;
    transition: width 0.5s ease;
    scrollbar-width: none; /* firefox */
    -ms-overflow-style: none; /* IE 10+ */

    &::-webkit-scrollbar {
      display: none;
    }
  }

  .el-main {
    background-color: #f0f2f5;
  }
}
</style>
